package com.example.basecore.boot;

import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextInitializer;
import org.springframework.context.ConfigurableApplicationContext;

/**
 * @author ycd0075
 * @date 2024-01-25 22:07
 */
public class Bootstrap implements ApplicationContextInitializer<ConfigurableApplicationContext> {
    private ApplicationContext context;

    public void setApplicationContext(ApplicationContext context) throws BeansException {
        this.context = context;
    }

    public void initialize(ConfigurableApplicationContext context) {
        context.addBeanFactoryPostProcessor(new RegistryBeanProcessor());
    }
}
